package com.huirui.server.pojo.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@Schema(description = "秒杀商品视图对象，用于展示秒杀商品的基本信息和活动信息")
public class SeckillVo {

    @Schema(description = "商品ID", example = "1001", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long productId;

    @Schema(description = "商品名称", example = "限时秒杀手机", requiredMode = Schema.RequiredMode.REQUIRED)
    private String productName;

    @Schema(description = "秒杀商品状态")
    private Integer status;

    @Schema(description = "商品图片URL", example = "https://example.com/images/phone.jpg")
    private String productImageUrl;

    @Schema(description = "商品原价（最低）", example = "5999.00", type = "number", format = "decimal")
    private BigDecimal minProductPrice;

    @Schema(description = "商品原价（最高）", example = "6999.00", type = "number", format = "decimal")
    private BigDecimal maxProductPrice;

    @Schema(description = "秒杀价（最低）", example = "4999.00", type = "number", format = "decimal", requiredMode = Schema.RequiredMode.REQUIRED)
    private BigDecimal minSeckillPrice;

    @Schema(description = "秒杀价（最高）", example = "5999.00", type = "number", format = "decimal")
    private BigDecimal maxSeckillPrice;

    @Schema(description = "商品总库存数量", example = "1000", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long stock;

    @Schema(description = "可用库存数量（剩余可秒杀数量）", example = "800", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long availableStock;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(description = "秒杀开始时间", example = "2025-11-11T10:00:00", type = "string", format = "date-time", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime seckillStartTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(description = "秒杀结束时间", example = "2025-11-11T12:00:00", type = "string", format = "date-time", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime seckillEndTime;
}
